/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fyx.secure.controll;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.fyx.secure.entity.SecureGroup;

/**
 *
 * @author xljan
 */
@Stateless
public class SecureGroupFacade extends AbstractFacade<SecureGroup> implements SecureGroupFacadeLocal {

    @PersistenceContext(unitName = "FyxCorePU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public SecureGroupFacade() {
        super(SecureGroup.class);
    }

    @Override
    public SecureGroup findByName(String name) {
        return em.createNamedQuery("SecureGroup.findByName", SecureGroup.class).
                setParameter("name", name).getSingleResult();
    }
}
